package xyz.scoder;

public class Light {

    private int state = 0;

    public void on() {
        this.state = 1;
        System.out.println("开灯");
    }

    public void off() {
        this.state = 0;
        System.out.println("关灯");
    }

    public void bad() {
        this.state = 2;
    }

    public int getState() {
        return this.state;
    }
}
